﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Protocol;

[DebuggerDisplay("{ToDebuggerDisplay(),nq}")]
public record Location
{
    /// <summary>
    ///     The uri of the document
    /// </summary>
    public required DocumentUri Uri { get; init; }


    /// <summary>
    ///     The range inside the document given by the uri
    /// </summary>
    public required Range Range { get; init; }


    public string ToDebuggerDisplay()
    {
        return $"{{{Range} {Uri}}}";
    }

    /// <summary>
    ///     <inheritdoc />
    /// </summary>
    public override string ToString()
    {
        return ToDebuggerDisplay();
    }
}